<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('gid')->comment('商品ID');
            $table->string('gname')->comment('商品名称');
            $table->string('tid')->default(0)->comment('商品类别');
            $table->string('tname')->comment('商品类名');
            $table->float('price',8, 2)->default(0)->comment('价格');
            $table->unsignedInteger('cnt')->default(0)->comment('库存');
            $table->integer('scnt')->default(0)->comment('销量');
            $table->unsignedInteger('vcnt')->default(0)->comment('浏览量');
            $table->string('gpic')->nullable()->comment('图片名称');
            $table->text('gdesc')->nullable()->comment('商品描述');
            $table->unsignedInteger('status')->default(0)->comment('状态');
            $table->string('ctime')->default(0)->comment('创建时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('goods');
    }
}
